<div>
Description : <?=$PERMISSION['description']?>
<br><br>
</div>
<table width="80%">
	<tr>
	<?php
		for($x=0;$x<count($fields[DATA]);$x++){ 
			echo "<th  width=15%>(".$fields[DATA][$x][LABEL].")</th>";
		}
	 ?>
	 <td align="center">Action</td>
 	</tr>
				<?php
					 forEach($record as $rec){ ?>
					 <tr>
					 <?php
					 	for($x=0;$x<count($fields[DATA]);$x++)
				     	 	echo "<td>" . $rec[ $fields[DATA][$x][FIELDS] ] . "</td>";
				     ?>
				     <td  align="center">
						 <?php if($PERMISSION[CAN_VIEW]):?>
						 	[<a onclick="return loadbyaction('{URL}/{page}/view/' , '{page}' , '<?=$rec['id'];?>');">view</a>]
						 <?php endif;?>
						<?php if($PERMISSION[CAN_EDIT]):?>
						 	[<a href="{URL}/{page}/edit2/<?=$rec['id'];?>">edit</a>]
						 <?php endif;?>
						 <?php if($PERMISSION[CAN_DELETE]): ?>
						 	[<a onclick="return deleteRecord('{URL}/{page}/ajaxdelete/<?=$rec['id']?>' , 'tr_main_{page}_details_<?=$rec['id']?>' , '{page}' , '<?=$rec['id']?>')">delete</a>]
						 <?php endif;?>
					 </td>
					</tr>
					<?php 
					}
					 ?>
	 
</table>